<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php



class MUploadFileController
    extends MApplicationComponent 
    implements MIController
{
    
    public function invoke()
    {
        FXP::trace(FXP::t('Begin to process {class}::{function}',
            array('{class}'=>get_class($this), '{function}'=>__FUNCTION__)));
                                parent::init();
                                $keys = array ('Filename','key');
        if (MSecurity :: verification($keys, $_POST) == false) {
            FXP::log(FXP::t("Request is Error, keys:'{$keys}'"), MLogger::LEVEL_ERROR);
            throw new MException(FXP::t(MConst::INVLID_REQUEST), MConst::UPLOAD_FILE_FAILS);
        }
                                if (!MUtils::create(DOCUMENT_ROOT_BLOCK, $_POST, $_FILES, true)) {
            throw new MException(FXP::t(MConst::INVLID_REQUEST), MConst::UPLOAD_FILE_FAILS);
        }
        FXP::trace(FXP::t('end to process {class}::{function}',
            array('{class}'=>get_class($this), '{function}'=>__FUNCTION__)));
    }
    
    
    public function handleException($exception)
    {
        return header("HTTP/1.1 ". $exception->getCode());
    }

}

?>